package cn.tedu.uep.order.controller;

import cn.tedu.uep.base.response.JsonResult;
import cn.tedu.uep.order.pojo.vo.OrderVO;
import cn.tedu.uep.order.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/v1/order")
@Slf4j
public class OrderController {

    @Autowired
    OrderService orderService;

    @GetMapping("/select/{userId}")
    public JsonResult select(@PathVariable Long userId){
        log.debug("查询订单参数orderQuery={}",userId);
        List<OrderVO> list =  orderService.selectOrder(userId);
        return JsonResult.ok(list);

    }


}
